home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / getlines.zip / GETLINES.MAN < prev    next >
Text File  |  1994-05-21  |  3KB  |  87 lines

  1. GETLINES(1V)               TEXT UTILITIES                GETLINES(1V)
  2.  
  3. NAME
  4.     getlines - Show specified lines of text file given line number(s)
  5.  
  6. AUTHOR
  7.     Jason Mathews
  8.     NASA/Goddard Space Flight Center
  9.     Code 633.2
  10.     Greenbelt, Maryland  20771
  11.     <mathews@nssdca.gsfc.nasa.gov>
  12.  
  13. COPYRIGHT
  14.     Copyright (C) 1994 by Jason Mathews.  Permission is granted to any
  15.     individual or institution to use, copy or modify this software so
  16.     long as it is not sold for profit, provided this copyright notice
  17.     is retained.
  18.  
  19. AVAILABILITY
  20.     GETLINES is available for MS-DOS, UNIX, and VMS systems with ANSI
  21.     compilers.
  22.  
  23. SYNOPSIS
  24.     GETLINES [filename] [-ln] [-cn] [-n]
  25.  
  26. DESCRIPTION
  27.     Given a list of line numbers within a specifed text file,
  28.     GETLINES displays the corresponding lines.  GETLINES can be
  29.     used within a flat-file database system to show entries in
  30.     a database given their relative line numbers.
  31.  
  32. OPTIONS
  33.     -ln  Display line number n, where n >= 1.  The default is 1.
  34.  
  35.     -cn  Display n lines.  The default is 1.
  36.  
  37.     -n   Precede each line by its relative line number in the file.
  38.  
  39.     If -l and -c are not specified then the line number input is
  40.     accepted from stdin.  If stdin is from the console then the
  41.     user will be prompted for each line.  If line numbers are
  42.     read from stdin then each line must be entered on a new line
  43.     followed by a carriage return.
  44.  
  45.     If filename is not specified then it is entered from stdin.
  46.  
  47. EXAMPLES
  48.  
  49.     Get line numbers 1000-1020 from the file 'testfile.c':
  50.  
  51.         GETLINES testfile.c -l1000 -c20
  52.  
  53.     Generate line numbers from a program and pipe the output
  54.     into getlines as the input stream:
  55.  
  56.         PROGRAM | GETLINES textfile.dat
  57.  
  58.     Pipe line numbers from file 'numbers.lst' and show
  59.     the line numbers along with corresponding text:
  60.  
  61.         GETLINES foo.c -n < numbers.lst
  62.  
  63.         Prompt user for input:
  64.  
  65.                 GETLINES
  66.                 Filename to search: bar.c
  67.         Line number to extract: 100
  68.  
  69. DIAGNOSTICS
  70.         Exit status is 0 if successful, 1 for syntax errors or
  71.         inaccessible file.
  72.  
  73.     Invalid line <n>: <file> only has <m> lines
  74.         Line number exceeds the number of lines in the file.
  75.  
  76.     Illegal line number <n>
  77.         Either line number is not an integer or is non-positive.
  78.  
  79.     Illegal parameter or value: <parameter>
  80.         Either -c and -l parameter values are illegal (zero or
  81.         negative) or an invalid parameter is used.
  82.  
  83.     Cannot open <filename>: <reason>
  84.         Either filename cannot be read or does not exist.
  85.  
  86. MS-DOS/UNIX Release 1.0    Last Change: 21 May 1994
  87.